package com.wxg.his;

import com.jfinal.core.Controller;

public class HisController extends Controller{

	private static int repeatedSubmissionCount = 0;
	
	/**
	 * 
六月 30, 2016 3:44:24 下午 org.apache.jasper.servlet.JspServlet serviceJspFile
严重: PWC6117: File "C%3A%5Cwxg6%5Cmytoolkit%5Cjfinal_my_demo%5Csrc%5Cmain%5Cwebapp%5Chis%5Chistest%5CrepeatedSubmission.jsp" not found
	 *
HTTP ERROR 404
Problem accessing /his/histest/repeatedSubmission.jsp. Reason:
    Not Found
	 * 
	 * 如果渲染对象是相对根目录的， 以 `/`开始即可。
	 * 
	 */
	public void index() {
		//String webRootPath = PathKit.getWebRootPath();
		renderJsp( "/histest/repeatedSubmission.jsp" );
	}
	
	/**
	 * Repeated submission 重复提交
	 */
	@SuppressWarnings("static-access")
	public void repeatedSubmission(){
		long millis = 1000;
		String who = getPara("who");
		System.out.printf("(%d) who : %s\n", repeatedSubmissionCount++, who);
		try {
			Thread.currentThread().sleep(millis);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		renderJson(true);
	}
	
	/**
	 * 验证iframe中加载的js文件是否能够访问parent中的function
	 * 
	 * Full Screen 及全屏，是一个css样式控制，经测可用!
	 * 
	 */
	public void homefullscreen(){
		renderJsp("/histest/homeFullScreen.jsp");
	}
	
	public void fooaaa(){
		renderJsp("/histest/foo/aaa.jsp");
	}
	
	public void foobbb(){
		renderJsp("/histest/foo/bbb.jsp");
	}
}
